
USE [master]
GO

/****** Object:  Database [dmis]    Script Date: 07/25/2022 11:06:06 ******/
CREATE DATABASE [dmis] ON  PRIMARY 
( NAME = N'dmis', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\dmis.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'dmis_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\dmis_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [dmis] SET COMPATIBILITY_LEVEL = 100
GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [dmis].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO

ALTER DATABASE [dmis] SET ANSI_NULL_DEFAULT OFF 
GO

ALTER DATABASE [dmis] SET ANSI_NULLS OFF 
GO

ALTER DATABASE [dmis] SET ANSI_PADDING OFF 
GO

ALTER DATABASE [dmis] SET ANSI_WARNINGS OFF 
GO

ALTER DATABASE [dmis] SET ARITHABORT OFF 
GO

ALTER DATABASE [dmis] SET AUTO_CLOSE OFF 
GO

ALTER DATABASE [dmis] SET AUTO_CREATE_STATISTICS ON 
GO

ALTER DATABASE [dmis] SET AUTO_SHRINK OFF 
GO

ALTER DATABASE [dmis] SET AUTO_UPDATE_STATISTICS ON 
GO

ALTER DATABASE [dmis] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO

ALTER DATABASE [dmis] SET CURSOR_DEFAULT  GLOBAL 
GO

ALTER DATABASE [dmis] SET CONCAT_NULL_YIELDS_NULL OFF 
GO

ALTER DATABASE [dmis] SET NUMERIC_ROUNDABORT OFF 
GO

ALTER DATABASE [dmis] SET QUOTED_IDENTIFIER OFF 
GO

ALTER DATABASE [dmis] SET RECURSIVE_TRIGGERS OFF 
GO

ALTER DATABASE [dmis] SET  DISABLE_BROKER 
GO

ALTER DATABASE [dmis] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO

ALTER DATABASE [dmis] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO

ALTER DATABASE [dmis] SET TRUSTWORTHY OFF 
GO

ALTER DATABASE [dmis] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO

ALTER DATABASE [dmis] SET PARAMETERIZATION SIMPLE 
GO

ALTER DATABASE [dmis] SET READ_COMMITTED_SNAPSHOT OFF 
GO

ALTER DATABASE [dmis] SET HONOR_BROKER_PRIORITY OFF 
GO

ALTER DATABASE [dmis] SET  READ_WRITE 
GO

ALTER DATABASE [dmis] SET RECOVERY SIMPLE 
GO

ALTER DATABASE [dmis] SET  MULTI_USER 
GO

ALTER DATABASE [dmis] SET PAGE_VERIFY CHECKSUM  
GO

ALTER DATABASE [dmis] SET DB_CHAINING OFF 
GO




USE [dmis]
GO

/****** Object:  Table [dbo].[handover_report]    Script Date: 2022-08-22 09:48:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[handover_report](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[weather] [varchar](20) NULL,
	[dept] [varchar](50) NOT NULL,
	[sup_instructions] [varchar](60) NULL,
	[temp_adjustment] [varchar](200) NULL,
	[accident] [varchar](200) NULL,
	[power_rationing] [varchar](200) NULL,
	[equipment_defect] [varchar](200) NULL,
	[equipment_repair] [varchar](200) NULL,
	[communication] [varchar](200) NULL,
	[protect_changes] [varchar](200) NULL,
	[grounding_information] [varchar](200) NULL,
	[scheduled_work] [varchar](200) NULL,
	[handover_yes] [int] NULL,
	[create_time] [smalldatetime] NULL,
	[hand_man] [varchar](50) NULL,
	[over_man] [varchar](50) NULL,
	[hand_time] [smalldatetime] NULL,
	[over_time] [smalldatetime] NULL,
	[handover_time] [smalldatetime] NULL,
 CONSTRAINT [PK_handover_report] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_weather]  DEFAULT ('') FOR [weather]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_sup_instructions]  DEFAULT ('') FOR [sup_instructions]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_temp_adjustment]  DEFAULT ('') FOR [temp_adjustment]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_accident]  DEFAULT ('') FOR [accident]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_power_rationing]  DEFAULT ('') FOR [power_rationing]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_equipment_defect]  DEFAULT ('') FOR [equipment_defect]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_equipment_repair]  DEFAULT ('') FOR [equipment_repair]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_communication]  DEFAULT ('') FOR [communication]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_protect_changes]  DEFAULT ('') FOR [protect_changes]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_grounding_information]  DEFAULT ('') FOR [grounding_information]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_scheduled_work]  DEFAULT ('') FOR [scheduled_work]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_handover_yes]  DEFAULT ((0)) FOR [handover_yes]
GO

ALTER TABLE [dbo].[handover_report] ADD  CONSTRAINT [DF_handover_report_create_time]  DEFAULT (getdate()) FOR [create_time]
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'电网事故' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'handover_report', @level2type=N'COLUMN',@level2name=N'accident'
GO


/****** Object:  Table [dbo].[handover_report_log]    Script Date: 2022-08-22 09:50:35 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[handover_report_log](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[log_time] [varchar](30) NOT NULL,
	[log_record] [varchar](300) NULL,
	[report_id] [int] NOT NULL,
	[create_time] [smalldatetime] NULL,
	[order_id] [smallint] NULL,
 CONSTRAINT [PK_handover_report_log] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[handover_report_log] ADD  CONSTRAINT [DF_handover_report_log_create_time]  DEFAULT (getdate()) FOR [create_time]
GO


